from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import DefaultConfig
from controller.index import index
from controller.login import login
from controller.restaurant_list import restaurant_list
from controller.restaurant_detail import restaurant_detail


app = Flask(__name__)
app.secret_key = "ele_me"
app.config.from_object(DefaultConfig)
db = SQLAlchemy(app)

# 关联路由
app.register_blueprint(index)
app.register_blueprint(login)
app.register_blueprint(restaurant_list)
app.register_blueprint(restaurant_detail)

if __name__ == '__main__':
    app.run()
